#include <stdio.h>
#include <math.h>
int main()
{
	while (1)
	{
		char card[3];
		int i,total,Anum;
		total=0;
        i=0;
		Anum=0;
		for (i=0;i<3;i++)
		{
         printf("Now we are entering the %i card.\n",i+1);
         scanf("%c",card[i]);
		 if (card[i]=='J'||card[i]=='Q'|card[i]=='K')
		 {
             total+=10;
         }
		if (card[i]=='A')
        {
            total+=11;
            Anum++;
        }
        else
        {
            total+=card[i];
        }
		}
    if (total>21)
    {
        total=total-10*Anum;
    }
	printf("total=%i\n\n\n",total);
	printf("start next round\n");
	}
	return 0;
}